package com.shop2cn.iapi.promotion.testcase;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.promotion.parameter.PlaceOrderCalculateReq;
import com.shop2cn.iapi.promotion.parameter.PlaceOrderCalculateResp;
import com.shop2cn.iapi.promotion.parameter.ProductDto;
import com.shop2cn.iapi.promotion.parameter.ProductPromotionInfoDto;
import com.shop2cn.iapi.promotion.parameter.PromotionValueDto;
import com.shop2cn.iapi.promotion.parameter.SellerProductDto;
import com.shop2cn.iapi.promotion.parameter.ShoppingCartCalculateReq;
import com.shop2cn.iapi.promotion.parameter.ShoppingCartCalculateResp;
import com.shop2cn.iapi.promotion.serivce.CalcShoppingCartPromotionInfoCall;
import com.shop2cn.iapi.promotion.serivce.PromotionInfoVerify;
import com.shop2cn.iapi.sellerpromotion.parameter.CreatePromotionBean;
import com.shop2cn.iapi.sellerpromotion.parameter.PromotionItem;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.Shop2cnSellerPromotionCallService;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;
/**
*计算购物车优惠信息
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_CalcShoppingCartPromotionInfo{
	private static ShoppingCartCalculateReq calcshoppingcartpromotioninfoBean;
	private static CalcShoppingCartPromotionInfoCall calcshoppingcartpromotioninfoCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("计算购物车优惠信息");
	}

	@Before
	public void caseUp() {
		calcshoppingcartpromotioninfoBean=new ShoppingCartCalculateReq();
		calcshoppingcartpromotioninfoCall=new CalcShoppingCartPromotionInfoCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(calcshoppingcartpromotioninfoCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	public ShoppingCartCalculateReq initShoppingCartCalculateReq(Integer mchId,List<ProductDto> pdtos) {
		ShoppingCartCalculateReq ShoppingCartCalculateReq=new ShoppingCartCalculateReq();
		ShoppingCartCalculateReq.setBuyerId(111);
		List<SellerProductDto> sellerProductDtos=new ArrayList<SellerProductDto>();
		SellerProductDto sellerProductDto=new SellerProductDto();
		sellerProductDto.setSellerId(mchId);
		List<ProductDto> productDtos=new ArrayList<ProductDto>();
		pdtos.forEach(p->{
			ProductDto productDto=new ProductDto();
			productDto.setProductId(p.getProductId());
			productDto.setCatalogId(p.getCatalogId());
			productDto.setCurrency(p.getCurrency());
			productDto.setProductQty(p.getProductQty());
			productDto.setProductUnitPrice(p.getProductUnitPrice());
			productDtos.add(productDto);
		});
		sellerProductDto.setProductDtos(productDtos);
		sellerProductDtos.add(sellerProductDto);
		ShoppingCartCalculateReq.setSellerProductDtos(sellerProductDtos);
		return ShoppingCartCalculateReq;
	}
	private void verifyProductPromotionInfoDto(List<ProductDto> returnpdtos, List<ProductDto> sendpdtos) {
		returnpdtos.forEach(rp->{
			ProductDto sendpdto = sendpdtos.stream().filter(s->{return s.getProductId().equals(rp.getProductId());}).findFirst().get();
			Logger.verifyEquals(sendpdto.getProductId(), rp.getProductId(), "验证返回ProductId");
			Logger.verifyEquals(sendpdto.getCatalogId(), rp.getCatalogId(), "验证返回CatalogId");
			Logger.verifyEquals(sendpdto.getProductUnitPrice(), rp.getProductUnitPrice(), "验证返回ProductUnitPrice");
			Logger.verifyEquals(sendpdto.getProductQty(), rp.getProductQty(), "验证返回ProductQty");
			Logger.verifyEquals(sendpdto.getProductUnitPrice().multiply(new BigDecimal(sendpdto.getProductQty())), rp.getProductTotalPrice(), "验证返回ProductTotalPrice");
		});
		
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_001() {
		Logger.start(true,"计算购物车优惠信息-全场满件减1,满2件减1");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_002() {
		Logger.start(true,"计算购物车优惠信息-全场满件折2,满2件9折");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 2,Arrays.asList(new PromotionItem(1, 2, 9d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_003() {
		Logger.start(true,"计算购物车优惠信息-全场满额减3,满100件减10");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 3,Arrays.asList(new PromotionItem(1, 100, 10d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(10).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_004() {
		Logger.start(true,"计算购物车优惠信息-全场满额折4,满100件9折");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 4,Arrays.asList(new PromotionItem(1, 100, 9d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_005() {
		Logger.start(true,"计算购物车优惠信息-指定商品满件减1,满2件减1");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			Thread.sleep(500);
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_006() {
		Logger.start(true,"计算购物车优惠信息-指定商品满件折2,满2件9折");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 2,Arrays.asList(new PromotionItem(1, 2, 9d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_007() {
		Logger.start(true,"计算购物车优惠信息-指定商品满额减3,满100元减10");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 3,Arrays.asList(new PromotionItem(1, 100, 10d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(10).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_008() {
		Logger.start(true,"计算购物车优惠信息-指定商品满额折4,满100元9折");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 4,Arrays.asList(new PromotionItem(1, 100, 9d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_009() {
		Logger.start(true,"计算购物车优惠信息-全场满件减1,多级满2件减1,满5件减2");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d),new PromotionItem(2, 5, 2d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 5, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			 ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId,sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(2).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			//验证当前优惠和下级优惠
			PromotionValueDto NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			PromotionValueDto CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满5件-2
			Logger.verifyEquals(BigDecimal.valueOf(2).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(5, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			Logger.verifyEquals(null,NextPromotionValueDto,"验证下一级");
			
			pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证当前优惠和下级优惠
			NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满2件-1
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(2, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			//下一级满5件-2
			Logger.verifyEquals(BigDecimal.valueOf(2).setScale(2), NextPromotionValueDto.getValue().setScale(2), "验证下一级优惠金额");
			Logger.verifyEquals(5, NextPromotionValueDto.getQtyCondition(), "验证下一级条件-按件");
			Logger.verifyEquals(0, NextPromotionValueDto.getAmountCondition().intValue(), "验证下一级条件-按额度");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_010() {
		Logger.start(true,"计算购物车优惠信息-全场满件折2,多级满2件9折,满5件8折");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 2,Arrays.asList(new PromotionItem(1, 2, 9d),new PromotionItem(2, 5, 8d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 5, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			 ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId,sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(100).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			//验证当前优惠和下级优惠
			PromotionValueDto NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			PromotionValueDto CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满5件-8折
			Logger.verifyEquals(BigDecimal.valueOf(0.8).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(5, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			Logger.verifyEquals(null,NextPromotionValueDto,"验证下一级");
			
			pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证当前优惠和下级优惠
			NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满2件9折
			Logger.verifyEquals(BigDecimal.valueOf(0.9).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(2, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			//下一级满5件-2
			Logger.verifyEquals(BigDecimal.valueOf(0.8).setScale(2), NextPromotionValueDto.getValue().setScale(2), "验证下一级优惠金额");
			Logger.verifyEquals(5, NextPromotionValueDto.getQtyCondition(), "验证下一级条件-按件");
			Logger.verifyEquals(0, NextPromotionValueDto.getAmountCondition().intValue(), "验证下一级条件-按额度");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_011() {
		Logger.start(true,"计算购物车优惠信息-全场满额减3,多级满100元10,满200元减20");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 3,Arrays.asList(new PromotionItem(1, 100, 10d),new PromotionItem(2, 200,20d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 5, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			 ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId,sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			//验证当前优惠和下级优惠
			PromotionValueDto NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			PromotionValueDto CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满200-20
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(200, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			Logger.verifyEquals(null,NextPromotionValueDto,"验证下一级");
			
			pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 1, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(10).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证当前优惠和下级优惠
			NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满100-10
			Logger.verifyEquals(BigDecimal.valueOf(10).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(100, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			//下一级满200件-20
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), NextPromotionValueDto.getValue().setScale(2), "验证下一级优惠金额");
			Logger.verifyEquals(0, NextPromotionValueDto.getQtyCondition(), "验证下一级条件-按件");
			Logger.verifyEquals(200, NextPromotionValueDto.getAmountCondition().intValue(), "验证下一级条件-按额度");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_012() {
		Logger.start(true,"计算购物车优惠信息-全场满额折4,多级满100元9折,满200元8折");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 4,Arrays.asList(new PromotionItem(1, 100, 9d),new PromotionItem(2, 200, 8d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 5, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			 ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId,sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(100).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			//验证当前优惠和下级优惠
			PromotionValueDto NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			PromotionValueDto CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满200-8折
			Logger.verifyEquals(BigDecimal.valueOf(0.8).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(200, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			Logger.verifyEquals(null,NextPromotionValueDto,"验证下一级");
			
			pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 1, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(10).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证当前优惠和下级优惠
			NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满2件9折
			Logger.verifyEquals(BigDecimal.valueOf(0.9).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(100, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			//下一级满5件-2
			Logger.verifyEquals(BigDecimal.valueOf(0.8).setScale(2), NextPromotionValueDto.getValue().setScale(2), "验证下一级优惠金额");
			Logger.verifyEquals(0, NextPromotionValueDto.getQtyCondition(), "验证下一级条件-按件");
			Logger.verifyEquals(200, NextPromotionValueDto.getAmountCondition().intValue(), "验证下一级条件-按额度");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_013() {
		Logger.start(true,"计算购物车优惠信息-指定商品满件减1,多级满2件减1,满5件减2");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d),new PromotionItem(2, 5, 2d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 5, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			 ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId,sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(2).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			//验证当前优惠和下级优惠
			PromotionValueDto NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			PromotionValueDto CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满5件-2
			Logger.verifyEquals(BigDecimal.valueOf(2).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(5, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			Logger.verifyEquals(null,NextPromotionValueDto,"验证下一级");
			pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证当前优惠和下级优惠
			NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满2件-1
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(2, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			//下一级满5件-2
			Logger.verifyEquals(BigDecimal.valueOf(2).setScale(2), NextPromotionValueDto.getValue().setScale(2), "验证下一级优惠金额");
			Logger.verifyEquals(5, NextPromotionValueDto.getQtyCondition(), "验证下一级条件-按件");
			Logger.verifyEquals(0, NextPromotionValueDto.getAmountCondition().intValue(), "验证下一级条件-按额度");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_014() {
		Logger.start(true,"计算购物车优惠信息-指定商品满件折2,多级满2件9折,满5件8折");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 2,Arrays.asList(new PromotionItem(1, 2, 9d),new PromotionItem(2, 5, 8d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 5, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			 ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId,sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(100).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			//验证当前优惠和下级优惠
			PromotionValueDto NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			PromotionValueDto CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满5件-8折
			Logger.verifyEquals(BigDecimal.valueOf(0.8).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(5, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			Logger.verifyEquals(null,NextPromotionValueDto,"验证下一级");
			
			pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证当前优惠和下级优惠
			NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满2件9折
			Logger.verifyEquals(BigDecimal.valueOf(0.9).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(2, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			//下一级满5件-2
			Logger.verifyEquals(BigDecimal.valueOf(0.8).setScale(2), NextPromotionValueDto.getValue().setScale(2), "验证下一级优惠金额");
			Logger.verifyEquals(5, NextPromotionValueDto.getQtyCondition(), "验证下一级条件-按件");
			Logger.verifyEquals(0, NextPromotionValueDto.getAmountCondition().intValue(), "验证下一级条件-按额度");
			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_015() {
		Logger.start(true,"计算购物车优惠信息-指定商品满额减3,多级满100元减10,满200元减20");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 3,Arrays.asList(new PromotionItem(1, 100, 10d),new PromotionItem(2, 200,20d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 5, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			 ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId,sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			//验证当前优惠和下级优惠
			PromotionValueDto NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			PromotionValueDto CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满200-20
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(200, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			Logger.verifyEquals(null,NextPromotionValueDto,"验证下一级");
			
			pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 1, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(10).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证当前优惠和下级优惠
			NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满100-10
			Logger.verifyEquals(BigDecimal.valueOf(10).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(100, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			//下一级满200件-20
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), NextPromotionValueDto.getValue().setScale(2), "验证下一级优惠金额");
			Logger.verifyEquals(0, NextPromotionValueDto.getQtyCondition(), "验证下一级条件-按件");
			Logger.verifyEquals(200, NextPromotionValueDto.getAmountCondition().intValue(), "验证下一级条件-按额度");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_016() {
		Logger.start(true,"计算购物车优惠信息-指定商品满额折4,多级满100元9折,满200元8折");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 4,Arrays.asList(new PromotionItem(1, 100, 9d),new PromotionItem(2, 200, 8d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 5, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			 ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId,sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(100).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			//验证当前优惠和下级优惠
			PromotionValueDto NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			PromotionValueDto CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满200-8折
			Logger.verifyEquals(BigDecimal.valueOf(0.8).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(200, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			Logger.verifyEquals(null,NextPromotionValueDto,"验证下一级");
			
			pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 1, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			productPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(10).setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证当前优惠和下级优惠
			NextPromotionValueDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getNextPromotionValueDto();
			CurrentPromotionValueDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getCurrentPromotionValueDto();
			//当前满2件9折
			Logger.verifyEquals(BigDecimal.valueOf(0.9).setScale(2), CurrentPromotionValueDto.getValue().setScale(2), "当前优惠金额");
			Logger.verifyEquals(0, CurrentPromotionValueDto.getQtyCondition(), "当前条件-按件");
			Logger.verifyEquals(100, CurrentPromotionValueDto.getAmountCondition().intValue(), "当前条件-按额度");
			//下一级满5件-2
			Logger.verifyEquals(BigDecimal.valueOf(0.8).setScale(2), NextPromotionValueDto.getValue().setScale(2), "验证下一级优惠金额");
			Logger.verifyEquals(0, NextPromotionValueDto.getQtyCondition(), "验证下一级条件-按件");
			Logger.verifyEquals(200, NextPromotionValueDto.getAmountCondition().intValue(), "验证下一级条件-按额度");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_017() {
		Logger.start(true,"计算购物车优惠信息-外币JPY全场满件减1,满2件减1");
		try {
			Integer mchId = GodmchManageCallService.CreateCountrySellerMch("JPN");
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			createpromotionBean.setCurrency("JPY");
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "JPY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_018() {
		Logger.start(true,"计算购物车优惠信息-外币JPY全场满件折2,满2件9折");
		try {
			Integer mchId = GodmchManageCallService.CreateCountrySellerMch("JPN");
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 2,Arrays.asList(new PromotionItem(1, 2, 9d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			createpromotionBean.setCurrency("JPY");
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "JPY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(20).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_019() {
		Logger.start(true,"计算购物车优惠信息-外币JPY全场满件折2,满2件9折-结果带小数时截断");
		try {
			Integer mchId = GodmchManageCallService.CreateCountrySellerMch("JPN");
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 2,Arrays.asList(new PromotionItem(1, 2, 9d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			createpromotionBean.setCurrency("JPY");
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 13d, 2, "JPY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			//日元取整
			Logger.verifyEquals(BigDecimal.valueOf(2).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_020() {
		Logger.start(true,"计算购物车优惠信息-全场满件减1,满2件减1-活动未开始不计算");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			createpromotionBean.setBegin(YMTDateUtil.getBeforeOrNextDay(1,"yyyy-MM-dd HH:mm:ss"));
			createpromotionBean.setEnd(YMTDateUtil.getBeforeOrNextDay(2,"yyyy-MM-dd HH:mm:ss"));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证不在活动中");
			//有一条
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_021() {
		Logger.start(true,"计算购物车优惠信息-全场满件折2,满2件9折-活动未开始不计算");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 2,Arrays.asList(new PromotionItem(1, 2, 9d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			createpromotionBean.setBegin(YMTDateUtil.getBeforeOrNextDay(1,"yyyy-MM-dd HH:mm:ss"));
			createpromotionBean.setEnd(YMTDateUtil.getBeforeOrNextDay(2,"yyyy-MM-dd HH:mm:ss"));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证不在活动中");
			//有一条
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_022() {
		Logger.start(true,"计算购物车优惠信息-全场满额减3,满100件减10-活动未开始不计算");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 3,Arrays.asList(new PromotionItem(1, 100, 10d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			createpromotionBean.setBegin(YMTDateUtil.getBeforeOrNextDay(1,"yyyy-MM-dd HH:mm:ss"));
			createpromotionBean.setEnd(YMTDateUtil.getBeforeOrNextDay(2,"yyyy-MM-dd HH:mm:ss"));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证不在活动中");
			//有一条
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_023() {
		Logger.start(true,"计算购物车优惠信息-全场满额折4,满100件9折-活动未开始不计算");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 4,Arrays.asList(new PromotionItem(1, 100, 9d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			createpromotionBean.setBegin(YMTDateUtil.getBeforeOrNextDay(1,"yyyy-MM-dd HH:mm:ss"));
			createpromotionBean.setEnd(YMTDateUtil.getBeforeOrNextDay(2,"yyyy-MM-dd HH:mm:ss"));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证不在活动中");
			//有一条
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_024() {
		Logger.start(true,"计算购物车优惠信息-全场满件减1,满2件减1-活动已结束不计算");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			Shop2cnSellerPromotionCallService.EndAllEnablePromotion(mchId);
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证不在活动中");
			//有一条
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_025() {
		Logger.start(true,"计算购物车优惠信息-全场满件折2,满2件9折-活动已结束不计算");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 2,Arrays.asList(new PromotionItem(1, 2, 9d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			Shop2cnSellerPromotionCallService.EndAllEnablePromotion(mchId);
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证不在活动中");
			//有一条
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_026() {
		Logger.start(true,"计算购物车优惠信息-全场满额减3,满100件减10-活动已结束不计算");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 3,Arrays.asList(new PromotionItem(1, 100, 10d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			Shop2cnSellerPromotionCallService.EndAllEnablePromotion(mchId);
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证不在活动中");
			//有一条
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_027() {
		Logger.start(true,"计算购物车优惠信息-全场满额折4,满100件9折-活动已结束不计算");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 4,Arrays.asList(new PromotionItem(1, 100, 9d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			Shop2cnSellerPromotionCallService.EndAllEnablePromotion(mchId);
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证不在活动中");
			//有一条
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_028() {
		Logger.start(true,"计算购物车优惠信息-指定商品满件减1,满2件减1-商品不是活动中商品不计算,验证NonProductPromotionInfos");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			String pid2 =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid2, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证不在活动中");
			//有一条
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_029() {
		Logger.start(true,"计算购物车优惠信息-指定商品满件减2,满2件9折-商品有活动中也有活动外商品,总数不达标不计算,验证NonProductPromotionInfos和InvalidPromotionInfos");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			String pid2 =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 2,Arrays.asList(new PromotionItem(1, 2, 9d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 1, "CNY"),new ProductDto(pid2, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证不在活动中");
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证存在参与商品的促销信息");
			Logger.verifyEquals(pid2,sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().get(0).getProductDtos().get(0).getProductId(), "验证"+pid2+"不参加活动");
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			Logger.verifyEquals(pid,sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().get(0).getProductDtos().get(0).getProductId(), "验证"+pid+"不达标无满减");
			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_030() {
		Logger.start(true,"计算购物车优惠信息-指定商品满件减1,满2件减1-商品有活动中也有活动外商品,总数达标计算");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			String pid2 =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"),new ProductDto(pid2, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(1, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_031() {
		Logger.start(true,"计算购物车优惠信息-指定商品满额减3,满100元减10-多个指定商品活动且sameProductUse为false,商品总金额超出计算(p1=60元p2=40元均参加活动)");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			String pid2 =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 3,Arrays.asList(new PromotionItem(1, 100, 10d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid,pid2));
			createpromotionBean.setSameProductUse(false);
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 60d, 1, "CNY"),new ProductDto(pid2, TestDataManager.getRandomUUID().toString(), 40d, 1, "CNY"));
			//预算优惠金额
			Map<String,BigDecimal> tempp=new HashMap<String,BigDecimal>();
			tempp.put(pid, BigDecimal.valueOf(6d));
			tempp.put(pid2, BigDecimal.valueOf(4d));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(10).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getProductDtos().forEach(p->{
				BigDecimal tp = tempp.get(p.getProductId());
				Logger.verifyEquals(tp.setScale(2), p.getPromotionValue().setScale(2), "验证优惠金额");
			});

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_032() {
		Logger.start(true,"计算购物车优惠信息-指定商品满额折4,满100元9折-多个指定商品活动且sameProductUse为true,商品总金额超出单个商品不超不计算(p1=60元p2=40元均参加活动不优惠-仅支持同商品满减),验证InvalidPromotionInfos");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			String pid2 =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 4,Arrays.asList(new PromotionItem(1, 100, 9d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid,pid2));
			createpromotionBean.setSameProductUse(true);
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 60d, 1, "CNY"),new ProductDto(pid2, TestDataManager.getRandomUUID().toString(), 40d, 1, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");
			//InvalidProductPromotionInfoDtos 这个场景没有优惠
			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(0).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().get(0).getProductDtos().forEach(p->{
				Logger.verifyEquals(BigDecimal.valueOf(0).setScale(2), p.getPromotionValue().setScale(2), "验证优惠金额");
			});
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_033() {
		Logger.start(true,"计算购物车优惠信息-混合场景-订单中有4个商品对应4个优惠场景均达标-计算优惠");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			String pid2 =TestDataManager.getRandomUUID().toString();
			String pid3 =TestDataManager.getRandomUUID().toString();
			String pid4 =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId1 = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			CreatePromotionBean createpromotionBean2 = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 2,Arrays.asList(new PromotionItem(1, 2, 9d)));
			createpromotionBean2.setProductIdList(Arrays.asList(pid2));
			Integer promotionId2 = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean2);
			
			CreatePromotionBean createpromotionBean3 = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 3,Arrays.asList(new PromotionItem(1, 100, 10d)));
			createpromotionBean3.setProductIdList(Arrays.asList(pid3));
			Integer promotionId3 = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean3);
			
			CreatePromotionBean createpromotionBean4 = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 4,Arrays.asList(new PromotionItem(1, 100, 9d)));
			createpromotionBean4.setProductIdList(Arrays.asList(pid4));
			Integer promotionId4 = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean4);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"),new ProductDto(pid2, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"),new ProductDto(pid3, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"),new ProductDto(pid4, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			 ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			
			List<ProductPromotionInfoDto> productPromotionInfoDtos = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos();
			//预算每个活动的实际减额
			Map<Integer,BigDecimal> m=new HashMap<Integer,BigDecimal>();
			m.put(promotionId1, BigDecimal.valueOf(1));
			m.put(promotionId2, BigDecimal.valueOf(20));
			m.put(promotionId3, BigDecimal.valueOf(10));
			m.put(promotionId4, BigDecimal.valueOf(20));
			productPromotionInfoDtos.forEach(productPromotionInfoDto->{
				PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
				try {
					promotionInfoVerify.verifyPromotionPolicyInDB(productPromotionInfoDto.getPromotionPolicyDto(),false);
				} catch (Exception e) {
					e.printStackTrace();
				}
				verifyProductPromotionInfoDto(productPromotionInfoDto.getProductDtos(),pdtos);
				BigDecimal value = m.get(productPromotionInfoDto.getPromotionPolicyDto().getPromotionId());
				Logger.verifyEquals(value.setScale(2), productPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			});
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_034() {
		Logger.start(true,"计算购物车优惠信息-全场满件减1,满2件减1.5-小数点支持");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1.5d)));
//			createpromotionBean.setProductIdList(Arrays.asList(pid));
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(1.5).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_035() {
		Logger.start(true,"计算购物车优惠信息-全场满件减1,满2件减1-免包邮-全国地区包邮");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
			
			createpromotionBean.getPromotionItemList().get(0).setfreeFreight(true);//免包邮
			
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			Thread.sleep(10000);
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证 ProductInfos 中freeFreight 新增2020-01-02 summing
			ProductDto productDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getProductDtos().get(0);
			Logger.comment("productDto.getfreeFreight():"+productDto.getfreeFreight());
			if(productDto!=null)
				 Logger.verifyEquals(true,productDto.getfreeFreight(), "验证ProductInfos中的FreeFreight");
			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_036() {
		Logger.start(true,"计算购物车优惠信息-全场满件减1,满2件减1-免包邮-上海地区包邮");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
			
			List<String> freeRegions=new ArrayList<>();
			freeRegions.add("上海");
			createpromotionBean.getPromotionItemList().get(0).setFreeRegions(freeRegions);//上海包邮
			createpromotionBean.getPromotionItemList().get(0).setfreeFreight(true);//免包邮
			
			
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			Thread.sleep(10000);
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证 ProductInfos 中freeFreight 新增2020-01-02 summing
			ProductDto productDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getProductDtos().get(0);
			Logger.comment("productDto.getfreeFreight():"+productDto.getfreeFreight());
			if(productDto!=null)
				 Logger.verifyEquals(false,productDto.getfreeFreight(), "验证ProductInfos中的FreeFreight");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_CalcShoppingCartPromotionInfo_037() {
		Logger.start(true,"计算购物车优惠信息-全场满件减1,满2件减1-不免包邮");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			String pid =TestDataManager.getRandomUUID().toString();
			CreatePromotionBean createpromotionBean = Shop2cnSellerPromotionCallService.initCreatePromotionBean(mchId, 1,Arrays.asList(new PromotionItem(1, 2, 1d)));
			
			createpromotionBean.getPromotionItemList().get(0).setfreeFreight(false);//免包邮
			
			Integer promotionId = Shop2cnSellerPromotionCallService.CreatepromotionCall(createpromotionBean);
			Thread.sleep(10000);
			List<ProductDto> pdtos=Arrays.asList(new ProductDto(pid, TestDataManager.getRandomUUID().toString(), 100d, 2, "CNY"));
			calcshoppingcartpromotioninfoBean=initShoppingCartCalculateReq(mchId, pdtos);
			calcshoppingcartpromotioninfoCall.setData(calcshoppingcartpromotioninfoBean);
			calcshoppingcartpromotioninfoCall.callService();
			Logger.verifyEquals("200", calcshoppingcartpromotioninfoCall.getCode(), "验证返回Code");
			ShoppingCartCalculateResp sellerProductsPromotionInfos = calcshoppingcartpromotioninfoCall.getData();
			Logger.verifyEquals(mchId, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getSellerId(), "验证返回SellerId");

			ProductPromotionInfoDto ValidProductPromotionInfoDto = sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0);
			PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
			promotionInfoVerify.verifyPromotionPolicyInDB(ValidProductPromotionInfoDto.getPromotionPolicyDto(),false);
			verifyProductPromotionInfoDto(ValidProductPromotionInfoDto.getProductDtos(),pdtos);
			Logger.verifyEquals(BigDecimal.valueOf(1).setScale(2), ValidProductPromotionInfoDto.getPromotionAmount().setScale(2), "验证优惠金额");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getNoneproductPromotionInfoDtos().size(), "验证不存在参与商品的促销信息");
			Logger.verifyEquals(0, sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getInvalidProductPromotionInfoDtos().size(), "验证参与但不满足条件的商品促销信息");
			
			//验证 ProductInfos 中freeFreight 新增2020-01-02 summing
			ProductDto productDto=sellerProductsPromotionInfos.getShoppingCartSellerPromotionDtos().get(0).getValidProductPromotionInfoDtos().get(0).getProductDtos().get(0);
			Logger.comment("productDto.getfreeFreight():"+productDto.getfreeFreight());
			if(productDto!=null)
				 Logger.verifyEquals(false,productDto.getfreeFreight(), "验证ProductInfos中的FreeFreight");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}